import React from 'react'
import { Link } from 'react-router-dom';
import './Header.css';
import {useAuth} from './Context'


const Header = (props) => {
    const { isLogin } = useAuth();
    console.log(props)
    return (
        <div className='header-wrap'>
            {/* {props.children} */}
            <div className='header'>
                <img className='logo' src='http://static2.cnodejs.org/public/images/cnodejs_light.svg' />
                <div>
                    <Link to='/'>首页</Link>
                    <Link to='/new'>新手入门</Link>
                    <Link to='/api'>API</Link>
                    <Link to='/collect'>收藏</Link>
                    <Link to='/user'>个人中心</Link>
                    {isLogin ? <button>退出</button> : <Link to='/login'>登录</Link>}


                </div>
            </div>
        </div>
    )
}

export default Header